package com.ksy.common.login;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Ksy.
 */

public class WeChatInfo implements Parcelable {
    public String openid;
    public String nickname;
    public String sex;
    public String province;
    public String city;
    public String country;
    public String headimgurl;
    public String unionid;
    public String token;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.openid);
        dest.writeString(this.nickname);
        dest.writeString(this.sex);
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.country);
        dest.writeString(this.headimgurl);
        dest.writeString(this.unionid);
        dest.writeString(this.token);
    }

    public WeChatInfo() {
    }

    protected WeChatInfo(Parcel in) {
        this.openid = in.readString();
        this.nickname = in.readString();
        this.sex = in.readString();
        this.province = in.readString();
        this.city = in.readString();
        this.country = in.readString();
        this.headimgurl = in.readString();
        this.unionid = in.readString();
        this.token = in.readString();
    }

    public static final Creator<WeChatInfo> CREATOR = new Creator<WeChatInfo>() {
        @Override
        public WeChatInfo createFromParcel(Parcel source) {
            return new WeChatInfo(source);
        }

        @Override
        public WeChatInfo[] newArray(int size) {
            return new WeChatInfo[size];
        }
    };

    @Override
    public String toString() {
        return "WeChatInfo{" +
                "openid='" + openid + '\'' +
                ", nickname='" + nickname + '\'' +
                ", sex='" + sex + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", country='" + country + '\'' +
                ", headimgurl='" + headimgurl + '\'' +
                ", unionid='" + unionid + '\'' +
                ", token='" + token + '\'' +
                '}';
    }
}
